package director;

import behavior.visitor.*;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class VisitorDirector {
    public static void main(String[] args){
        //初始化一堆Task
        List<Task> taskList = new ArrayList<>();
        for(int i=0;i<10;i++){
            taskList.add(new FeatureTask("F_"+i));
            taskList.add(new ModelTask("M_"+i));
        }
        Collections.shuffle(taskList);
        //数据准备完成
        Visitor printVisitor = new PrintVisitor();
        Visitor calculateVisitor = new CalculateVisitor();
        for(Task t: taskList){
            t.accept(printVisitor);
            t.accept(calculateVisitor);
        }

    }
}
